<template>
  <div>
    <div>上一站{{ current == 0 ? "无" : arr[current - 1] }}</div>
    <div>当前站{{ arr[current] }}</div>
    <div>下一站{{ current == arr.length - 1 ? "无" : arr[current + 1] }}</div>
    <button @click="current--" v-show="current == 0 ? false : true">
      prev
    </button>
    <button
      @click="current++"
      v-show="current == arr.length - 1 ? false : true"
    >
      next
    </button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [1, 2, 3, 4, 5, 6, 7, 8, 9],
      current: 3,
    };
  },
};
</script>

<style>
</style>

